<style>
.prof_items_price{
	display:block;
	float:right;
	margin-left:5px;
}
#filterProfiliPaketiForm{
	margin-right:2px;
	width:250px;
	clear:both;
}
#filterProfiliPaketiForm label.left{
	width:60px;
}
#ProfiliPaketiStage{
	width:600px;
}
#ProfiliPaketiStage table{
	width:100%;
}
#ProfiliPaketiStage table input.edit,
#ProfiliPaketiStage table input.novi,
#ProfiliPaketiStage table input.delete{
	padding:0px;
	border:none;
	background-color:transparent;
	width:16px;
	height:16px;
	cursor:pointer;
}
#profilPaketTemplate{
	width:250px;
	display:none;
	margin-bottom:2px;
}
#profilPaketTemplate label{
	width:60px;
}
#profilPaketTemplate legend input{
	float:none;
	border:none;
	background-color:transparent;
	margin:0px 2px;
	cursor:pointer;
}
#profilPaketTemplate ol input.delete{
	background-color:transparent;
	border:none;
	cursor:pointer;
	margin:0px;
	float:none;
}
#profilPaketTemplate ol select{
	margin:0px;
	float:none;
}
#profilPaketTemplate ol li{
	margin:2px 0px;
}
</style>
<div style="float:left; ">
	<div id="profilPaketTemplate" class="area">
		<form action="javascript:void(0)" onsubmit="profiliPaketiNewMakeItems(this); submitForm(this,'artikli.php','POST','afterProfiliPaketiNew',1)">
			<input type="hidden" name="a" value="profili_paketi" />
			<input type="hidden" name="mod" value="save" />
			
			<input type="hidden" name="id" value="{{$id}}" />
			<h1>Novi paket</h1>
			<label class="left" for="name">Naziv:</label>
			<input type="text" name="name" id="name" />
			
			<br clear="all" />
			<label class="left" for="profile_type">Tip profila:</label>
			<select name="profile_type" id="profile_type">
				{{%loop start profile_type_id}}
				<option value="{{$profile_type_id}}" {{$profile_type_selected}}>{{$profile_type_code}}</option>
				{{%loop end}}
			</select>
			
			<br clear="all" />
			<label class="left" for="art_id">Artikl:</label>
			<select name="art_id" id="art_id" style="width:150px;">
				{{%loop start art_id}}
				<option value="{{$art_id}}" {{$art_selected}}>{{$art_name}}</option>
				{{%loop end}}
			</select>
			
			<br clear="all" />
			<label class="left" for="date_start">Važi od:</label>
			<input type="text" name="date_start" id="date_start" class="dateInput" />
			<input type="button" class="datePicker" onclick="displayDatePicker('date_start',this)" />
			
			<br clear="all" />
			<label class="left" for="cena">Cena:</label>
			<input type="text" name="cena" id="cena" />
			
			<br clear="all" />
			<fieldset>
				<input type="hidden" name="items" id="items" />
				<legend>Stavke <input type="button" class="novi" onclick="ProfiliPaketiNewAddItem(this)" /></legend>
				<ol id="profiliPaketiNewItemsList">
					<li>
						<select>
							{{%loop start item_id}}
							<option value="{{$item_id}}">{{$item_name}}</option>
							{{%loop end}}
						</select>
						<input type="button" class="delete" onclick="if(this.parentNode.parentNode.getElementsByTagName('li').length>1){this.parentNode.parentNode.removeChild(this.parentNode)}" />
					</li>
				</ol>
			</fieldset>
			
			<br clear="all" />
			<input type="submit" class="save" value="sačuvaj" />
		</form>
	</div>
	
	<form id="filterProfiliPaketiForm" class="area" action="javascript:void(0)" onSubmit="submitForm(this,'artikli.php','POST','setContent',1)">
		<input type="hidden" name="a" value="profili_paketi" />
		<h2>Filter</h2>
		
		<label class="left" for="filter_name">Naziv:</label>
		<input type="text" name="filter_name" id="filter_name" value="{{$filter_name}}" />
	
		<br clear="all" />
		<label class="left" for="filter_date">Važi od:</label>
		<input type="text" class="dateInput" name="filter_date" id="filter_date" value="{{$filter_date}}" />
		<input type="button" class="datePicker" onClick="displayDatePicker('filter_date',this);" />
		
		<br clear="all" />
		<label class="left" for="filter_profile_type">Tip profila:</label>
		<select name="filter_profile_type" id="filter_profile_type">
			<option value="null">---</option>
			{{%loop start profile_type_id}}
			<option value="{{$profile_type_id}}" {{$profile_type_selected}}>{{$profile_type_code}}</option>
			{{%loop end}}
		</select>
		
		<br clear="all" />
		<fieldset>
			<legend>Stavke</legend>
			{{%loop start item_id}}
			<input style="margin:5px;" type="checkbox" name="filter_item_{{$item_id}}" id="filter_item_{{$item_id}}" {{$item_selected}}/>
			<label style="float:left; margin-top:3px;" for="filter_item_{{$item_id}}">{{$item_name}}</label><br clear="all" />
			{{%loop end}}
		</fieldset>
		
		<br clear="all" />
		<label class="left" for="filter_price">Cena:</label>
		<input type="text" name="filter_price" id="filter_price" value="{{$filter_price}}" />
		
		<br clear="all" />
		<input type="submit" name="sbmt" style="float:right" value="filter" />
	</form>
	<br clear="all" />
</div>
<div class="area" id="ProfiliPaketiStage">
	<table>
		<tr class="head" align="center">
			<td>naziv</td>
			<td>važi od</td>
			<td>tip profila</td>
			<td>artikl</td>
			<td>sadržaj</td>
			<td>cena</td>
			<td><input type="button" class="novi" title="novi" onclick="var obj=document.getElementById('profilPaketTemplate'); obj.style.display=obj.style.display=='block'?'none':'block'" /></td>
		</tr>
		{{%loop start id}}
		<tr valign="top">
			<td>{{$name}}</td>
			<td>{{$date}}</td>
			<td>{{$profile}}</td>
			<td>{{$art}}</td>
			<td>{{$items}}</td>
			<td align="right">{{$price}}</td>
			<td>
				{{$admin_start}}
				<input type="button" class="delete" title="obriši..." onclick="if(confirm('Da li želite da obrišete &quot;{{$name}}&quot;?')){LoadRSDoc('artikli.php?a=profili_paketi&mod=delete&id={{$id}}','afterDeleteProfilPaket')}" /><br clear="all" />
				<input type="button" class="edit" title="izmeni..." onclick="LoadRSDoc('artikli.php?a=profili_paketi&mod=edit&id={{$id}}','ypAjaxForm')" />
				{{$admin_end}}
			</td>
		</tr>
		{{%loop end}}
	</table>
	{{$comment_start}}
	{{$comment_end}}
</div>
